<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>系统管理-组织机构管理</title>
		<jsp:include page="../../include/base.jsp"></jsp:include>
		<jsp:include page="../../include/common.jsp"></jsp:include>
		<script src="../MainHandler.js" type="text/javascript"></script>
		<script src="orgPanel.js" type="text/javascript"></script>

		<style type="text/css">
body {
	margin: 0;
	padding: 0;
	border: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

<!--
用于修正miniUI的分页条信息不显示的BUG  -->#orgUserPager .mini-pager-left {
	position: absolute;
	top: 0;
	left: 0;
}

#orgUserPager .mini-pager-right {
	position: absolute;
	top: 0;
	right: 0;
}
</style>

	</head>
	<body>

		<div class="mini-layout" splitSize="3"
			style="width: 100%; height: 100%;">
			<div region="north" height="32px" showHeader="false" allowResize="true" >
			 	<div class="mini-toolbar" style="border:0;font-size:12px;padding-left:6px;">
		            <a id="system_org_add" class="mini-button" iconCls="icon-addnew" plain="false" visible="false" onclick="OrgPanel.add">新增机构</a>
		            <a id="system_org_edit" class="mini-button" iconCls="icon-edit" plain="false" visible="false" onclick="OrgPanel.edit">编辑机构</a>
		            <a id="system_org_del" class="mini-button" iconCls="icon-remove" plain="false" visible="false" onclick="OrgPanel.del">删除机构</a>
		            <a id="system_org_setuser" class="mini-button" iconCls="app-btn-tool" plain="false" visible="false" onclick="OrgPanel.showUserSet">设置机构用户</a>
		            <a id="system_org_deluser" class="mini-button" iconCls="app-btn-del" plain="false" visible="false" onclick="OrgPanel.delOrgUser">取消机构用户</a>
		            <span class="separator"></span>
		            <a id="system_org_reload" class="mini-button" iconCls="icon-btn-refresh" plain="false" visible="false" onclick="OrgPanel.reload">刷新</a>
				</div>
			 </div>

			<div region="west" showHeader="false" allowResize="true"
				width="600px" maxWidth="660px" minWidth="400px;" style="border-bottom:0;">
				<div class="mini-fit">
					<div id="orgTreegrid" class="mini-treegrid" expandOnLoad="0" showTreeIcon="true"
						showCheckBox="false" treeColumn="name" idField="porgId" parentField="pfunId" 
						resultAsTree="false" onNodeClick="OrgPanel.loadOrgUser"
						style="width: 100%; height: 100%;" borderStyle="border:0;">
						<div property="columns">
							<div name="name" field="name" width="200" headerAlign="center" allowSort="true">
								机构名称
							</div>
							<div field="code" width="150" headerAlign="center" allowSort="true">
								机构编码
							</div>
						</div>
					</div>
				</div>
			</div>

			<div region="center" style="border: 0;">
				<div id="orgDatagrid" class="mini-datagrid" fitColumns="true" multiSelect="true"
					showFooter="false" idField="userId" style="width: 100%; height: 100%;"
					borderStyle="border-right:0; border-bottom:0;">
					<div property="columns">
						<div type="checkcolumn"></div>
						<div field="nickName" width="100" align="center"
							headerAlign="center" allowSort="true">
							机构下属用户
						</div>
						<div field="uname" width="100" align="center" headerAlign="center"
							allowSort="true">
							登录名
						</div>
						<div field="phone" width="100" align="center" headerAlign="center">
							电话
						</div>
						<div field="remark" width="80" align="center" allowSort="true"
							headerAlign="center">
							备注
						</div>
					</div>
				</div>
			</div>
		</div>




		<div id="orgEditWindow" class="mini-window" title="管理机构"
			style="width: 500px;" showModal="true" allowResize="false"
			allowDrag="true">
			<div id="orgEditform" class="form">
				<input class="mini-hidden" name="orgId" />
				<input class="mini-hidden" id="orgEditWindowPorgId" name="porgId" />
				<table style="width: 100%;">
					<tr>
						<td style="width: 100px;" align="right">
							是否顶级机构：
						</td>
						<td style="width: 200px;" align="center">
							<input name="isRoot" class="mini-checkbox" />
							选中表示顶级机构
						</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">
							上级机构：
						</td>
						<td style="width: 300px;" align="center">
							<input id="orgTreeselect" name="porgName" class="mini-treeselect"
								style="width: 250px" multiSelect="false" textField="name"
								valueField="orgId" onValueChanged="OrgPanel.treeSelectChanged" />
						</td>
					</tr>
					<tr>
						<td align="right">
							机构名称：
						</td>
						<td align="center">
							<input name="name" class="mini-textbox" required="true"
								style="width: 250px" />
						</td>
						<td style="color: red;">
							必填
						</td>
					</tr>
					<tr>
						<td align="right">
							机构编码：
						</td>
						<td align="center">
							<input name="code" class="mini-textbox" style="width: 250px"
								required="true" />
						</td>
						<td style="color: red;">
							必填
						</td>
					</tr>
					<tr>
						<td align="right">
							备注说明：
						</td>
						<td align="center">
							<input name=remark class="mini-textbox" style="width: 250px" />
						</td>
					</tr>
					<tr>
						<td
							style="text-align: center; padding-top: 5px; padding-right: 20px;"
							colspan="6">
							<a class="mini-button " plain="true" iconCls="icon-add"
								onclick="OrgPanel.save">保存</a>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a class="mini-button" plain="true" iconCls="icon-remove"
								onclick="OrgPanel.closeOrgButton">关闭</a>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a class="mini-button " plain="true" iconCls="icon-add"
								onclick="OrgPanel.save('yes');">另存为</a>
						</td>
					</tr>
				</table>
			</div>
		</div>

		<div id="orgUserEditWindow" class="mini-window" title="设置机构用户"
			style="width: 700px; height: 500px" showModal="true"
			allowResize="false" allowDrag="true">
			<table style="width: 100%;">
				<tr>
					<td style="height: 420px" align="left">
						<div class="mini-fit">

							<div id="orgUserDatagrid" class="mini-datagrid"
								style="width: 100%;" idField="userId" fitColumns="true"
								multiSelect="true" showFooter="false">
								<div property="columns">
									<div type="checkcolumn"></div>
									<div type="indexcolumn" width="50" headerAlign="center">
										序号
									</div>
									<div field="nickName" width="100" align="center"
										headerAlign="center" allowSort="true">
										姓名
									</div>
									<div field="uname" width="100" align="center"
										headerAlign="center" allowSort="true">
										登录名
									</div>
									<div field="ucode" width="100" align="center"
										headerAlign="center">
										编码
									</div>
									<div field="phone" width="100" align="center" allowSort="true"
										headerAlign="center">
										手机
									</div>
									<div field="remark" width="100%" align="center"
										allowSort="true" headerAlign="center">
										备注
									</div>
								</div>
							</div>
						</div>
						<div class="mini-pager" id="orgUserPager"
							style="border: solid 1px #ccc;"
							onpagechanged="OrgPanel.pagechanged" sizeList="[5,10,20]">
						</div>
					</td>
				</tr>
				<tr>
					<td
						style="text-align: center; padding-top: 5px; padding-right: 20px;"
						colspan="6">
						<a class="mini-button " plain="true" iconCls="icon-add"
							onclick="OrgPanel.saveOrgUser">确定</a>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a class="mini-button" plain="true" iconCls="icon-remove"
							onclick="OrgPanel.closeOrgUserButton">关闭</a>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					</td>
				</tr>
			</table>
		</div>

		<script type="text/javascript">
	mini.parse();
	OrgPanel.init();
</script>

	</body>
</html>
